from typing import List, Dict
from champions.base_champion import Champion
class BattleUI:
    
    def __init__(self):
        pass
    
    def show_battle_start(self, team1: List, team2: List, arena_name: str):
        print("\\n" + "=" * 60)
        print(f"battle start: {arena_name}")
        print("=" * 60)
        
        print("\\n team1:")
        for champion in team1:
            print(f"  {champion.name} - {champion.get_champion_type()}")
        
        print("\\n team2:")
        for champion in team2:
            print(f"  {champion.name} - {champion.get_champion_type()}")
        
        print("\\n" + "=" * 60)
    
    def show_turn_start(self, turn_number: int):
        print(f"\\n round {turn_number}")
    
    def show_action_result(self, result: Dict):
        if result.get("success"):
            print(f"[success] {result.get('message', '')}")
            if "damage" in result:
                print(f"cause damage: {result['damage']}")
            if "healing" in result:
                print(f"curative dose: {result['healing']}")
        else:
            print(f"[fail] {result.get('message', '')}")
    
    def show_champion_status(self, champion: Champion):
        status_icon = "[survive]" if champion.is_alive else "[die]"
        print(f"{status_icon} {champion.name}: {champion.health}/{champion.max_health} HP, {champion.mana}/{champion.max_mana} MP")
    
    def show_team_status(self, team: List[Champion], team_name: str):
        print(f"\\n{team_name}:")
        for champion in team:
            self.show_champion_status(champion)
    
    def show_battle_end(self, winner: str, survivors: List[str], total_turns: int):
        print("\\n" + "=" * 60)
        print("battle end!")
        print("=" * 60)
        print(f"winner: {winner}")
        if survivors:
            print(f"survivor: {', '.join(survivors)}")
        print(f"total round: {total_turns}")
        print("=" * 60)